// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class BtnItem extends cc.Component {
  /**
   * 格子地图
   */
  @property(cc.Sprite)
  show: cc.Sprite = null;

  start() {
    this.node.on(cc.Node.EventType.MOUSE_MOVE, this.onMouseMove, this);
    this.node.on(cc.Node.EventType.MOUSE_LEAVE, this.onMouseLeave, this);
  }

  onMouseMove() {
    this.node.scale = 1.2;
  }

  onMouseLeave() {
    this.node.scale = 1;
  }
}
